package com.base.engine.graphics;

import com.base.engine.error.ColorException;

public class Color3f {
	
	public static Color3f toColor3f(Color4f color){
		return new Color3f(color.getRed(), color.getGreen(), color.getBlue());
	}
	
	private float red ; 
	private float green ; 
	private float blue ; 
	
	public Color3f(float r, float g, float b){
		setRed(r);
		setGreen(g);
		setBlue(b);
	}

	public float getRed() {
		return red;
	}

	public void setRed(float red) {
		if(red>=0.0f && red<=1.0f)
			this.red = red;
		else
			ColorException.InvalidColorValue("red"); 
	}

	public float getGreen() {
		return green;
	}

	public void setGreen(float green) {
		if(green>=0.0f && green<=1.0f)
			this.green = green;
		else
			ColorException.InvalidColorValue("green"); 
	}

	public float getBlue() {
		return blue;
	}

	public void setBlue(float blue) {
		if(blue>=0.0f && blue<=1.0f)
			this.blue = blue;
		else
			ColorException.InvalidColorValue("blue"); 
	}
	
	

}
